import request from "@/utils/request";
import { MenuAddDataType, MenuItemType } from "./types";

/**
 * 获取菜单列表
 * @returns
 */
export const reqGetMenuList = () => {
  return request.get<null, MenuItemType>(`/admin/acl/permission`);
};

/**
 * 请求添加菜单
 * @param data
 * @returns
 */
export const reqAddMenuInfo = (data: MenuAddDataType) => {
  return request.post(`/admin/acl/permission/save`, data);
};
/**
 * 请求修改菜单
 * @param data
 * @returns
 */
export const reqUpdateMenuInfo = (data: MenuAddDataType) => {
  return request.put(`/admin/acl/permission/update`, data);
};
